﻿<fieldset>
    <legend>Member Login</legend>
    <p>Your User Name:<br />
        <input type="text" id="loginUserName"   /></p>
    <p>Your Password:<br />
        <input type="password" id="loginPassword"  /></p>

</fieldset>
<p>
    <input type="button" value="Login" onclick="javascript: userlogin();" />
</p>



<script type="text/javascript">
    function userlogin() {
        $.ajax({
            url: '/User/Login',
            type: 'POST',
            contentType: 'application/json',
            data: JSON.stringify(
                {
                    loginUserName: $("#loginUserName").val(),
                    loginPassword: $("#loginPassword").val()
                }),
            success: function (result) {
                var obj = jQuery.parseJSON(result);
                if (obj.success) {
                    document.location = "/Schedule";
                } else {
                   alert("Wrong");
                }
            }
        });
        return false;

    }
    
    
</script>
